From: Gabriel Wicke Date: Fri, 24 Mar 2006 16:38:34 +0000 (+0000) Subject: Handle urls as external-url args X-Git-Tag: 1.6.0~155 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=e804f4543ee787babfd5ce90fd5b0798f8da1673;p=lhc%2Fweb%2Fwiklou.git Handle urls as external-url args --- diff --git a/includes/Parser.php b/includes/Parser.php index eb1f3f2f34..33bfadfa06 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1207,6 +1207,19 @@ class Parser $url = $protocol . $m[1]; $trail = $m[2]; + # special case: handle urls as url args: + # http://www.example.com/foo?=http://www.example.com/bar + if(strlen($trail) == 0 && + isset($bits[$i]) && + preg_match('/^'. wfUrlProtocols() . '$/S', $bits[$i]) && + preg_match( '/^('.EXT_LINK_URL_CLASS.'+)(.*)$/s', $bits[$i + 1], $m )) + { + # add protocol, arg + $url .= $bits[$i] . $bits[$i + 1]; # protocol, url as arg to previous link + $i += 2; + $trail = $m[2]; + } + # The characters '<' and '>' (which were escaped by # removeHTMLtags()) should not be included in # URLs, per RFC 2396.